<!DOCTYPE html>
<html>
<head>
    <title>附件信息</title>
    <meta name="layout" content="main2"/>
    <asset:stylesheet src="homer/vendor/viewer/viewer.min.css"/>
</head>

<body>
<div class="main-body">
  <div class="page-wrapper">
    <div class="page-header">
            <div class="page-header-title">
                <h4>查看附件</h4>
            </div>

            <div class="page-header-breadcrumb">
                <ul class="breadcrumb-title">
                    <li class="breadcrumb-item">
                        <a href="/salesDashboard/index">
                            <i class="icofont icofont-home"></i>
                        </a>
                    </li>

                    <li class="breadcrumb-item">查看附件</li>
                </ul>
            </div>
        </div>
        <div class="page-body">
          <g:if test="${flash.message}">
              <div class="message alert alert-info" role="status">${flash.message}
                  <button type="button" class="close" data-dismiss="alert" aria-label="Close">
                      <span aria-hidden="true">×</span></button>
              </div>
          </g:if>
          <g:hasErrors bean="${this.attachment}">
              <ul class="errors" role="alert">
                  <g:eachError bean="${this.attachment}" var="error">
                      <li <g:if test="${error in org.springframework.validation.FieldError}">data-field-id="${error.field}"</g:if>><g:message
                              error="${error}"/></li>
                  </g:eachError>
              </ul>
          </g:hasErrors>
          <div class="card">

            <div class="card-block panel-wells docs-pictures">
              <div class="row">
                  <div class="col-md-3">
                      <div class="panel panel-default">
                          <div class="panel-heading txt-white">
                              ${this.attachment?.type?.name}
                          </div>
                          <div class="panel-body">
                            <g:if test="${this.attachment?.fileName?.split('\\.')[-1] in ['doc', 'docx', 'pdf', 'xlsx', 'xls']}">
                                <a href="${this.attachment?.fileUrl}">附件信息：${this.attachment?.fileName?.split('/')[-1]}
                                    <h5 class="text-info">点击查看</h5>
                                </a>
                            </g:if>
                            <g:if test="${this.attachment?.fileName?.split('\\.')[-1] in ['jpg', 'png', 'jpeg']}">
                                <a href="javascript:;" title="${this.attachment?.type?.name}">
                                    <g:if test="${this.attachment?.thumbnailUrl}">
                                        <img src="${this.attachment?.thumbnailUrl}" data-original="${this.attachment?.fileUrl}"
                                             alt="${this.attachment?.type?.name}"/>
                                    </g:if>
                                    <g:else>
                                        <img src="${this.attachment?.fileUrl}" data-original="${this.attachment?.fileUrl}"
                                             alt="${this.attachment?.type?.name}"/>
                                    </g:else>
                                </a>
                            </g:if>
                          </div>
                          <div class="panel-footer">
                              <g:if test="${this.attachment?.description}">
                                  <g:link class="btn-link description-edit" controller="attachment" action="edit" params="[id: this.attachment?.id]" data-toggle="tooltip" data-placement="left"
                                          title="${this.attachment?.description}">${this.attachment?.description}
                                  </g:link>
                              </g:if>
                              <g:formatDate date="${this.attachment.createdDate}" format="yyyy-MM-dd HH:mm:ss"></g:formatDate>
                          </div>
                      </div>
                  </div>
              </div>

            </div>
          </div>
        </div>
    
        </div>
</div>
<asset:javascript src="homer/vendor/viewer/viewer.min.js"/>
<asset:javascript src="homer/vendor/viewer/main.js"/>
</body>
</html>
